package com.mybdqn.service;

import com.mybdqn.pojo.UserRole;
import com.mybdqn.dao.UserRoleMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* Service Class UserRole
*
* 2017-12-14
*/

@Service
@Transactional
public class UserRoleServiceImpl implements UserRoleService {

    @Resource
    private UserRoleMapper userRoleMapper;

    @Transactional(readOnly = true)
    public UserRole getUserRoleById(Integer id)throws Exception{
        return userRoleMapper.getUserRoleById(id);
    }

    @Transactional(readOnly = true)
    public List<UserRole> getUserRoleListByMap(Map<String,Object> param)throws Exception {
        return userRoleMapper.getUserRoleListByMap(param);
    }
    
    @Transactional(readOnly = true)
    public Integer getUserRoleRecCountByMap(Map<String,Object> param)throws Exception {
    	return userRoleMapper.getUserRoleRecordCount(param);
    }
    

    public Integer insertUserRole(UserRole userRole)throws Exception {
        return userRoleMapper.insertUserRole(userRole);
    }

    public Integer updateUserRole(UserRole userRole)throws Exception {
        return userRoleMapper.updateUserRole(userRole);
    }

    public Integer deleteUserRoleById(Integer id)throws Exception {
        return userRoleMapper.deleteUserRoleById(id);
    }

}